package appconfig

import (
	"github.com/spf13/viper"
	"log"
)

type AppConfig struct {
	MysqlConfig
	Sensitive
}
type MysqlConfig struct {
	Host     string
	Post     int
	User     string
	Password string
	Database string
}
type Sensitive struct {
	Ak string
	Sk string
}

var AppCon AppConfig

func Init() {
	viper.SetConfigFile("appconfig/dev.yaml")
	viper.ReadInConfig()
	viper.Unmarshal(&AppCon)
	log.Println("动态数据连接成功", AppCon)
}
